/**
 * 评论接口模块
 */
import request from '@/utils/request'

/**
 * 获取文章列表
 */
export const getComments = params => {
  return request({
    method: 'GET',
    /*url: '/v1_0/comment',*/
    url: '/comment/allComments',
    params
  })
}

/**
 * 评论点赞
 */
export const addCommentLike = addLike => {
  return request({
    method: 'POST',
    url: '/v1_0/comment/addCommentLike',
    data: {
      addLike
    }
  })
}

/**
 * 取消评论点赞
 */
export const deleteCommentLike = deleteLike => {
  return request({
    method: 'DELETE',
    url: `/v1_0/comment/deleteCommentLike/${deleteLike}`
  })
}

/**
 * 添加评论或评论回复
 */
export const addComment = data => {
  return request({
    method: 'POST',
    url: '/v1_0/addComment',
    data
  })
}